<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of rosegrad</title>
  <meta name="keywords" content="rosegrad">
  <meta name="description" content="ROSEGRAD Calculate gradient of Rosenbrock's function.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../menu.html">Home</a> &gt;  <a href="#">ReBEL-0.2.7</a> &gt; <a href="#">netlab</a> &gt; rosegrad.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../menu.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="menu.html">Index for .\ReBEL-0.2.7\netlab&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>rosegrad
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>ROSEGRAD Calculate gradient of Rosenbrock's function.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function g = rosegrad(x) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">ROSEGRAD Calculate gradient of Rosenbrock's function.

    Description
    G = ROSEGRAD(X) computes the gradient of Rosenbrock's function at
    each row of X, which should have two columns.

    See also
    <a href="demopt1.html" class="code" title="function demopt1(xinit)">DEMOPT1</a>, <a href="rosen.html" class="code" title="function y = rosen(x)">ROSEN</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function g = rosegrad(x)</a>
0002 <span class="comment">%ROSEGRAD Calculate gradient of Rosenbrock's function.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%    Description</span>
0005 <span class="comment">%    G = ROSEGRAD(X) computes the gradient of Rosenbrock's function at</span>
0006 <span class="comment">%    each row of X, which should have two columns.</span>
0007 <span class="comment">%</span>
0008 <span class="comment">%    See also</span>
0009 <span class="comment">%    DEMOPT1, ROSEN</span>
0010 <span class="comment">%</span>
0011 
0012 <span class="comment">%    Copyright (c) Ian T Nabney (1996-2001)</span>
0013 
0014 <span class="comment">% Return gradient of Rosenbrock's test function</span>
0015 
0016 nrows = size(x, 1);
0017 g = zeros(nrows,2);
0018 
0019 g(:,1) = -400 * (x(:,2) - x(:,1).^2) * x(:,1) - 2 * (1 - x(:,1));
0020 g(:,2) = 200 * (x(:,2) - x(:,1).^2);</pre></div>
<hr><address>Generated on Tue 26-Sep-2006 10:36:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>